/**
 * 处理页面标题的多语言
 * @param {Object} title 页面标题
 */
export function generateTitle(title) {
  // console.log(title, '我是title')
  const hasKey = this.$te('route.' + title)
  if (hasKey) {
    // $t :this method from vue-i18n, inject in @/lang/index.js
    const translatedTitle = this.$t('route.' + title)

    return translatedTitle
  }
  return title
}
